package com.lmq.wxshare.common;

import java.util.Formatter;
import java.util.UUID;

public class WXCommon {

    public static String getuuid(){
        String uuid = UUID.randomUUID().toString().replace("-", "");
        return  uuid;
    }

    //字节数组转换为十六进制字符串
    public static String byteToHex(final byte[] hash) {
        Formatter formatter = new Formatter();
        for (byte b : hash)
        {
            formatter.format("%02x", b);
        }
        String result = formatter.toString();
        formatter.close();
        return result;
    }

    public static void main(String[] args) {
        UUID uuid = UUID.randomUUID();
        System.out.println(uuid);
    }

}
